﻿@model IEnumerable<WebApplication.Models.Nodes>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table class="table">
    <tr>
        <th>
            @Html.DisplayName("Id")
        </th>
        <th>
            @Html.DisplayName("Spare")
        </th>
        <th>
            @Html.DisplayName("Activ")
        </th>
        <th>
            @Html.DisplayName("Work")
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayName(item.Id)
        </td>
        <td>
            @Html.DisplayName(item.Spare.ToString())
        </td>
        <td>
            @Html.DisplayName(item.Activ.ToString())
        </td>
        <td>
     @if (item.Work != null)
     {

         @Html.DisplayName(item.Work.name)
     }
        </td>
        <td>
     
            @Html.ActionLink("Details", "Details", new { id=item.Id }) 
     
        </td>
    </tr>
}

</table>
